import request from '@/utils/Request.js';

export function login(data) {
    return request.post('/login', data);
}

export function getUserInfo() {
    return request.get('/user/info');
}

//分页查询
export function getUserList(params) {
    return request.get('/admin/list', params);
}

//新增用户
export function createUser(data) {
    return request.post('/admin/add', data);
}

//更新用户
export function updateUser(id, data) {
    return request.put(`/admin/update/${id}`, data);
}

//批量删除接口
export function deleteUser(ids) {
    return request.delete('/admin/delete', ids);
}

//查询回显
export function getUserDetail(id) {
    return request.get(`/admin/detail/${id}`);
}